package com.turing.mission.controller;

import com.alibaba.fastjson.JSONObject;
import com.turing.mission.service.MyMissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import result.Result;

@RestController
public class MyMissionController {

    @Autowired
    private MyMissionService myMissionService;

    @PostMapping("/myMission/myMissionSave")
    public Result myMissionSave(@RequestBody JSONObject jsonObject){
        return myMissionService.myMissionSave(jsonObject);
    }

    @GetMapping("/myMission/myMissionList")
    public Result myMissionList(
            @RequestParam(value = "mtId", required = false) String mtId,
            @RequestParam(value = "missonId", required = false) String missonId,
            @RequestParam(value = "sortType",required = false) Integer sortType,
            @RequestParam(value = "orderType") Integer orderType,
            @RequestParam(value = "pageNum",required = false) Integer pageNum,
            @RequestParam(value = "pageSize",required = false) Integer pageSize
    ){
        return myMissionService.myMissionList(mtId,missonId,sortType,orderType,pageNum,pageSize);
    }
}
